<template>
  <!-- use3 根元素不再是必要条件 -->
  <div class="main intro_page">
    <ul class="ip_header">
      <li class="iph_item" v-for="(t, i) in indexGuide" :key="i" @click="changeView(t.path)">{{ t.name }}</li>
    </ul>
    <el-carousel class="ip_carousel" :interval="5000" arrow="always" height="500px">
      <el-carousel-item class="ipc_item" v-for="item in 4" :key="item">
        <div class="item_content">
          <div class="ic_img"></div>
          <div class="ic_intro"></div>
        </div>
      </el-carousel-item>
    </el-carousel>
    <div class="ip_banner">
      <div class="ipb_title"></div>
      <div class="ipb_content"></div>
    </div>
    <div class="ip_more"></div>
    <div class="ip_copyright"></div>
  </div>
</template>

<script setup lang="ts">
import router from '@/router'
import useBasicStore from '@/store/basic'

const indexGuide = [
  {
    name: '首页',
    path: ''
  }, {
    name: '商城',
    path: ''
  }, {
    name: '我的',
    path: ''
  }, {
    name: '后台',
    path: 'back'
  }
]


const changeView = (path: string) => {
   router.push({ path })
}

</script>

<style lang="less" scoped>
.intro_page {
  .ip_header {
    width: 100%;
    height: 40px;
    line-height: 40px;
    display: flex;
    flex-flow: row nowrap;
    justify-content: center;
    .iph_item {
      text-align: center;
      width: 80px;
      margin: 0 20px;
      cursor: pointer;
      font-size: 14px;
    }
  }
  .ip_carousel {
    width: calc(100% - 40px);
    margin: 20px;
    .ipc_item {
      height: 500px;
      .item_content {
        width: 100%;
        height: 100%;
        display: flex;
        flex-flow: row nowrap;
        .ic_img {
          height: 100%;
          aspect-ratio: 16 / 9;
        }
        .ic_intro {
          flex-grow: 1;
        }
      }
    }
  }
  .ip_banner {
    aspect-ratio: 8 / 1;
    margin: 20px 0;
  }
  .ip_more {
    height: auto;
    min-height: 600px;
    margin: 20px 0;
  }
  .ip_copyright {
    height: 200px;
  }
}
</style>
